﻿using SelfMadeMillionaire.Core.Entities;
using SelfMadeMillionaire.Core.Repositories;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SelfMadeMillionaire.DAL.Repositories
{
	public class OrderRepository : Repository<Order>, IOrderRepository
	{
		public OrderRepository(IUnitOfWork uow)
			: base(uow)
		{
		}

		public override Order Update(Order entity)
		{
			var order = Get(entity.ID);

			order.ProductType = entity.ProductType;
			order.SubscriptionLevel = entity.SubscriptionLevel;
			order.Status = entity.Status;
		    order.PromoCode = entity.PromoCode;

			Commit();

			return order;
		}
	}
}
